# -*- coding: utf-8 -*-
import os
import sys

from loguru import logger

from config.baseConfiguration import LogConfiguration

logPath = LogConfiguration.logPath
format = LogConfiguration.format
logTime = LogConfiguration.logTime
logger.remove()
logger.add(sys.stderr, level="INFO", format=format, enqueue=True)
logger.add(os.path.join(logPath, f'runtime_{logTime}.log'), level="INFO", format=format, rotation="1 day",
           retention='3 days', compression='zip', enqueue=True)
logger.add(os.path.join(logPath, f'success_{logTime}.log'), level="SUCCESS", format=format, rotation="1 day",
           retention='3 days', compression='zip', enqueue=True)
logger.add(os.path.join(logPath, f'error_{logTime}.log'), level="ERROR", format=format, rotation="1 day",
           retention='3 days', compression='zip', enqueue=True)
